package com.crm.crm.service.impl;

import com.crm.crm.mapper.CrmPartnerFindMapper;
import com.crm.crm.service.CrmPartnerFindService;
import com.crm.entity.Partner;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author 秋水浮萍
 * @version 1.0.0
 * @ClassName PartnerFindServiceImpl.java
 * @Description TODO
 * @createTime 2021年03月04日 22:31:00
 */
@Service
public class CrmPartnerFindServiceImpl implements CrmPartnerFindService {
    @Autowired
    private CrmPartnerFindMapper mapper;
    @Override
    public PageInfo<Partner> findAssetInf(String createId, String company, Integer partnerType, String belong, String[] cities, String orgType, String orgRemark, String typeId, int pageIndex, int PageSize) {
        PageHelper.startPage(pageIndex,PageSize);
        List<Partner> list=mapper.findAssetInf(createId, company, partnerType, belong, cities, orgType, orgRemark, typeId);
        return  new PageInfo<>(list);
    }

    @Override
    public PageInfo<Partner> findFundInfo(String createId, String company, Integer partnerType, String orgType, String orgRemark, String currency, String incomeType, String struct, Integer scaleMin, Integer scaleMax, String deadline, String[] cities, String typeId, String typeName, Integer incomeRate, int pageIndex, int PageSize) {
        PageHelper.startPage(pageIndex,PageSize);
        List<Partner> list=mapper.findFundInfo(createId, company, partnerType, orgType, orgRemark, currency, incomeType, struct, scaleMin, scaleMax, deadline, cities, typeId, typeName, incomeRate);
        return  new PageInfo<>(list);
    }

    @Override
    public PageInfo<Partner> findExitInfo(String createId, String company, Integer partnerType, String orgType, String orgRemark, String usage, String typeId, String typeName, String[] cities, Integer abilityMin, Integer abilityMax, int pageIndex, int PageSize) {
        PageHelper.startPage(pageIndex,PageSize);
        List<Partner> list=mapper.findExitInfo(createId, company, partnerType, orgType, orgRemark, usage, typeId, typeName, cities, abilityMin, abilityMax);
        return  new PageInfo<>(list);
    }

    @Override
    public PageInfo<Partner> findJusticeInfo(String createId, Integer partnerType, String company, String post, String[] cities, int pageIndex, int PageSize) {
        PageHelper.startPage(pageIndex,PageSize);
        List<Partner> list=mapper.findJusticeInfo(createId, partnerType, company, post, cities);
        return  new PageInfo<>(list);
    }

    @Override
    public PageInfo<Partner> findPeerInfo(String createId, String company, Integer partnerType, String orgType, String bizListId, String coopListId, String[] cities, int pageIndex, int PageSize) {
        PageHelper.startPage(pageIndex,PageSize);
        List<Partner> list=mapper.findPeerInfo(createId, company, partnerType, orgType, bizListId, coopListId, cities);
        return  new PageInfo<>(list);
    }

    @Override
    public PageInfo<Partner> findOrgInfo(String createId, Integer partnerType, String company, String post, String[] cities, int pageIndex, int PageSize) {
        PageHelper.startPage(pageIndex,PageSize);
        List<Partner> list=mapper.findOrgInfo(createId, partnerType, company, post, cities);
        return  new PageInfo<>(list);
    }
}
